//
//  main.cpp
//  344.反转字符串
//
//  Created by Yan Zihao on 2024/9/28.
//

#include <iostream>
#include<vector>
using namespace std;

class Solution
{
public:
    void reverseString(vector<char>& s)
    {
        int n = s.size();
        int left,right;
        for(left = 0 ,right = n-1;left < right;left++,right--)
        {
            swap(s[left],s[right]);
        }
    }
};

int main(void)
{
    vector<char> s = {'h','e','l','l','o'};
    Solution().reverseString(s);
    for(auto ch : s)
    {
        cout << ch << " ";
    }
    cout << endl;
    return 0;
}
